/*
 * @Author: 1453937336@qq.com 1453937336@qq.com
 * @Date: 2024-06-04 14:44:32
 * @LastEditors: 1453937336@qq.com 1453937336@qq.com
 * @LastEditTime: 2024-06-04 14:56:38
 * @FilePath: \itforce-hris\src\utils\common\btn.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import store from "@/store/index";

export const getRouter = (currnetPers: string) => {
    const permis = store.getters.getUserInfo?.menuList ?? [];
    const newPermis: any = [];
    permis && permis.forEach((i: any) => {
        if (i.viewFlag) newPermis.push(`${i.path}:viewFlag`);
        if (i.modifyFlag) newPermis.push(`${i.path}:modifyFlag`);
        if (i.createFlag) newPermis.push(`${i.path}:createFlag`);
        if (i.removeFlag) newPermis.push(`${i.path}:removeFlag`);
        const otherPers = i.otherAuth;
        if (otherPers && otherPers.length) {
          otherPers.forEach((j: any) => {
            newPermis.push(`${i.path}:${j}`);
          });
        }
        
    });
    
    return newPermis.includes(currnetPers)
};
